<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="query.DataQuery, com.cinema.data.Adminusr, java.util.List" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="css/screen.css" type="text/css" media="screen" title="default" />
<title>Đồ Án Môn Học</title>
</head>

<body>
<%
	String value = (String)request.getAttribute("isadmin");
	if(value == null){
		response.sendError(HttpServletResponse.SC_FORBIDDEN, "Unauthorized Access");
	}
	List<Adminusr> userlist = DataQuery.getAdminUserList();
%>
<!-- Start: page-top-outer -->
<div id="page-top-outer">    

<!-- Start: page-top -->
	<div id="page-top">
		<div class="clear"></div>

	</div>
<!-- End: page-top -->

</div>
<!-- End: page-top-outer -->
	
<div class="clear">&nbsp;</div>
 
<!--  start nav-outer-repeat................................................................................................. START -->
<div class="nav-outer-repeat"> 
<!--  start nav-outer -->
	<div class="nav-outer"> 
			<!--  start nav -->
			<div class="nav">
				<div class="table">
				
					<div class="nav-divider">&nbsp;</div>
														
					<ul class="select">
						<li><a href="cp.jsp"><b>Movie</b></a>
						<div class="select_sub">
							<ul class="sub">
								<li><a href="cp.jsp">Add Movie</a></li>
								<li><a href="/ticket?pageid=2">Delete Movie</a></li>
								<li><a href="/ticket?pageid=1">Ticket</a></li>
							</ul>
						</div>
						</li>
					</ul>
					<div class="nav-divider">&nbsp;</div>
					<ul class="current">
						<li><a href="viewpage?id=1"><b>User Mangement</b></a>
							<div class="select_sub show">
								<ul class="sub">									
									<li><a href="viewpage?id=1">User List</a></li>
									<li><a href="viewpage?id=2">Add user</a></li>
									<li class="sub_show"><a href="viewpage?id=3">Remove user</a></li>
								</ul>
							</div>
						</li>
					</ul>
					
					
					<div class="nav-divider">&nbsp;</div>
					
					<div class="clear"></div>
				</div>
				<div class="clear"></div>
			</div>
			<!--  start nav -->

	</div>
	<div class="clear"></div>
<!--  start nav-outer -->
</div>
<!--  start nav-outer-repeat................................................... END -->
 
 <div class="clear"></div>
 
<!-- start content-outer -->
<div id="content-outer">
<!-- start content -->
	<div id="content">


		<div id="page-heading"><h1>User List</h1></div>


			<table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
				<tr>
					<th rowspan="3" class="sized"><img src="images/shared/side_shadowleft.jpg" width="20" height="300" alt="" /></th>
					<th class="topleft"></th>
					<td id="tbl-border-top">&nbsp;</td>
					<th class="topright"></th>
					<th rowspan="3" class="sized"><img src="images/shared/side_shadowright.jpg" width="20" height="300" alt="" /></th>
				</tr>
				<tr>
					<td id="tbl-border-left"></td>
					<td>
					<!--  start content-table-inner -->
						<div id="content-table-inner">
							<table border="0" width="100%" cellpadding="0" cellspacing="0">
								<tr valign="top">
									<td>
									
									
										<!--  start step-holder -->
										<div id="step-holder">
											<div class="step-dark-left"><a href="">Danh sách user</a></div>
											<div class="step-dark-right">&nbsp;</div>
										</div>
										<!--  end step-holder -->
									
										<!-- start id-form -->
										<form action="deleteAdminUser" method="post">
										<table border="1" cellpadding="3" cellspacing="0"  width="300" id="id-form">
										<tr>
											<td align="center" bgcolor="yellow">Username</td>
											<td align="center" bgcolor="yellow">Group</td>
										</tr>
<%
	if(!userlist.isEmpty()){
		for(Adminusr u: userlist){
%>
										<tr>
											<td align="center"><%= u.getUsername() %></td>
											<td align="center"><%= u.getGroupid() %></td>
											<td align="center">
											<input type="radio" name="username" value="<%= u.getUsername() %>" />
											</td>
										</tr>
<%
		}
	}
%>
										</table>
										<br/>
										<input type="submit" value="Delete">
										</form>
									<!-- end id-form  -->
									</td>
								</tr>
							</table>
						<br/>
						<div id="addresult"></div>
						<div class="clear"></div>
						</div>
						
						<!--  end content-table-inner  -->
					</td>
					<td id="tbl-border-right"></td>
				</tr>
				<tr>
					<th class="sized bottomleft"></th>
					<td id="tbl-border-bottom">&nbsp;</td>
					<th class="sized bottomright"></th>
				</tr>
			</table>
		</div>
	</div>
</div>
</body>
</html>